"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constDefine_1 = require("./constDefine");
let abiv = (constDefine_1.deployedContractData.abi || []);
console.log(abiv);
let abif = abiv.filter(part => part.type === "function");
console.log(abif);
console.log("\n-------------------\n");
let abiquery = abif.filter(fn => {
    const isQueryableWithParams = (fn.stateMutability === "view" || fn.stateMutability === "pure") && fn.inputs.length > 0;
    return isQueryableWithParams;
});
console.log(abiquery);
console.log("\n-------------------\n");
let abimap = abiquery.map(fn => {
    var _a;
    return {
        fn,
        inheritedFrom: (_a = constDefine_1.deployedContractData === null || constDefine_1.deployedContractData === void 0 ? void 0 : constDefine_1.deployedContractData.inheritedFunctions) === null || _a === void 0 ? void 0 : _a[fn.name],
    };
});
console.log(abimap);
console.log("\n-------------------\n");
let abisort = abimap.sort((a, b) => (b.inheritedFrom ? b.inheritedFrom.localeCompare(a.inheritedFrom) : 1));
console.log(abimap);
console.log("\n-------------------\n");
const functionsToDisplay = (constDefine_1.deployedContractData.abi || []).filter(part => part.type === "function")
    .filter(fn => {
    const isQueryableWithParams = (fn.stateMutability === "view" || fn.stateMutability === "pure") && fn.inputs.length > 0;
    return isQueryableWithParams;
})
    .map(fn => {
    var _a;
    return {
        fn,
        inheritedFrom: (_a = constDefine_1.deployedContractData === null || constDefine_1.deployedContractData === void 0 ? void 0 : constDefine_1.deployedContractData.inheritedFunctions) === null || _a === void 0 ? void 0 : _a[fn.name],
    };
})
    .sort((a, b) => (b.inheritedFrom ? b.inheritedFrom.localeCompare(a.inheritedFrom) : 1));
console.log(functionsToDisplay);
